//
//  LoginViewController.m
//  集金金融
//
//  Created by 李东晓 on 15/12/1.
//  Copyright © 2015年 李东晓. All rights reserved.
//

#import "LoginViewController.h"
#import "SureTZViewController.h"
#import "LogonViewController.h"
#import "ForgetCodeViewController.h"

#import "MBProgressHUD.h"
#import "MBProgressHUD+RY.h"
#import "MainTabViewController.h"
@interface LoginViewController ()
@property (strong, nonatomic) IBOutlet UIButton *LoginButton;

@end

@implementation LoginViewController
#pragma 确定刚进入界面时隐藏tabBar
-(void)viewWillAppear:(BOOL)animated
{
    [self.tabBarController.tabBar setHidden:YES];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self setTitle:@"用户登录"];
    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
    
    [_LoginButton.layer setCornerRadius:3];
    
    [_LoginButton.layer setMasksToBounds:YES];
    
    [self registerAndremove];
    
}
- (IBAction)LoginClick {
    
    NSLog(@"登录");
    SureTZViewController * secTo = [[SureTZViewController alloc]init];
    
    [self.navigationController pushViewController:secTo animated:YES];
    
    [MBProgressHUD showMessage:@"登录中。。。。。"];
    
    
    [MBProgressHUD hideHUD];
    
    
    
}
#pragma 注册＋取消按钮
-(void)registerAndremove
{

    //添加左按钮
    UIBarButtonItem *leftButton = [[UIBarButtonItem alloc]
                                   initWithTitle:@"取消"
                                   style:UIBarButtonItemStylePlain
                                   target:self
                                   action:@selector(LeftClick)];
    [leftButton setTintColor:[UIColor whiteColor]];
    [self.navigationItem setLeftBarButtonItem:leftButton];

    //添加右按钮
    UIBarButtonItem *rightButton = [[UIBarButtonItem alloc]
                                   initWithTitle:@"注册"
                                   style:UIBarButtonItemStylePlain
                                   target:self
                                   action:@selector(RightClick)];
    [rightButton setTintColor:[UIColor whiteColor]];
    [self.navigationItem setRightBarButtonItem:rightButton];
    
}
-(void)LeftClick
{
    //返回主页面
    //[self.navigationController popToRootViewControllerAnimated:YES];
    
    //返回上一个页面
    [self.navigationController popViewControllerAnimated:YES];
    
}

-(void)RightClick
{
    NSLog(@"注册");
    LogonViewController * logon = [[LogonViewController alloc]init];
    
    [self.navigationController pushViewController:logon animated:YES];
}

- (IBAction)ForgetCode {
    NSLog(@"忘记密码");
    ForgetCodeViewController * forget = [[ForgetCodeViewController alloc]init];
    [self.navigationController pushViewController:forget animated:YES];
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
